import request from '@/axios';
export const loginByUsername = (username, password, code, redomStr) => request({
  url:'/api/v1/oauth2/login',
  method: 'post',
  meta: {
    isToken: false
  },
  data: {
    principal:username,
    credentials:password,
    otherInfo:code,
    requestUniqueCode:redomStr,
    grantType:"password"
  }
})

export const getUserInfo = () => request({
  url: '/user/getUserInfo',
  method: 'get'
});

export const refreshToken = () => request({
  url: '/user/refresh',
  method: 'post'
})

export const getMenu = (type ) => request({
  url: '/api/v1/sysPermissionInfo/selectCurrentUserMenus',
  method: 'get',
});
export const sendLogs = (list) => request({
  url: '/user/logout',
  method: 'post',
  data: list
})

export const logout = () => request({
  url: '/user/logout',
  meta: {
    isToken: false
  },
  method: 'get'
})